
#include "stm32f4xx_hal.h"
#include "stm32_flash.h"

typedef void (*app_func_t)(void);

void jump_to_app(uint32_t address)
{
    __disable_irq();
    uint32_t app_addr = *(uint32_t *)(address + 4);
    app_func_t app = (app_func_t)app_addr;
    __set_MSP(*(uint32_t*)address);
    __enable_irq();
    app();
}

int main()
{
    jump_to_app(0x08008000);
    return 0;
}
